package com.cll.learn.queue;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2021/5/15 20:21
 */
public class WaitTest {

    public static void main(String[] args) {
        MyBlockingQueue myBlockingQueue = new MyBlockingQueue();
        Thread addThead1 = new Thread(new AddThread(myBlockingQueue));
        addThead1.start();
        Thread addThead2 = new Thread(new AddThread(myBlockingQueue));
        addThead2.start();
        Thread addThead3 = new Thread(new AddThread(myBlockingQueue));
        addThead3.start();

        Thread addThead4 = new Thread(new AddThread(myBlockingQueue));
        addThead4.start();
        Thread addThead5 = new Thread(new AddThread(myBlockingQueue));
        addThead5.start();

        Thread getThread = new Thread(new GetThread(myBlockingQueue));
        getThread.start();

        try {
            addThead1.join();
            addThead2.join();
            addThead3.join();
            addThead4.join();
            addThead5.join();
            getThread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
